--- title: dashboards keywords: fastai sidebar: home_sidebar summary: "Supplies dashboards to investigate datasets and training results. Dashboards are defined as classes, to show the dashboard use the .show() function on an dashboard instance." description: "Supplies dashboards to investigate datasets and training results. Dashboards are defined as classes, to show the dashboard use the .show() function on an dashboard instance." nb_path: "nbs/dashboards.ipynb" ---
{% raw %}
{% endraw %} {% raw %}
{% endraw %}

Test data setup

{% raw %}
import icedata
{% endraw %} {% raw %}
test_data_dir = icedata.fridge.load_data()
test_class_map = icedata.fridge.class_map()
test_parser = icedata.fridge.parser(test_data_dir, test_class_map)
test_train_records, test_valid_records = test_parser.parse()
test_valid_record_dataset = BboxRecordDataset(test_valid_records, test_class_map)
test_train_record_dataset = BboxRecordDataset(test_train_records, test_class_map)
test_record_dataset_no_class_map = BboxRecordDataset(test_train_records)
INFO     - Autofixing records | icevision.parsers.parser:parse:126
{% endraw %} {% raw %}

class ObjectDetectionDatasetOverview[source]

ObjectDetectionDatasetOverview(dataset:GenericDataset, height:int=500, width:int=500) :: DatasetOverview

Helper class that provides a standard way to create an ABC using inheritance.

{% endraw %} {% raw %}
{% endraw %} {% raw %}
test_object_detection_overview = ObjectDetectionDatasetOverview(test_valid_record_dataset, width=1500, height=900)
test_object_detection_overview.show()
{% endraw %} {% raw %}

class ObjectDetectionDatasetComparison[source]

ObjectDetectionDatasetComparison(datasets:List[GenericDataset], height:int=500, width:int=500) :: DatasetComparison

Helper class that provides a standard way to create an ABC using inheritance.

{% endraw %} {% raw %}
{% endraw %} {% raw %}
test_object_detection_comparison = ObjectDetectionDatasetComparison([test_valid_record_dataset, test_train_record_dataset], width=1700, height=700)
test_object_detection_comparison.show()
{% endraw %} {% raw %}

class ObjectDetectionDatasetGenerator[source]

ObjectDetectionDatasetGenerator(dataset, width=500, height=500) :: DatasetGenerator

Helper class that provides a standard way to create an ABC using inheritance.

{% endraw %} {% raw %}
{% endraw %} {% raw %}
test_dataset_generator = ObjectDetectionDatasetGenerator(test_train_record_dataset, height=1000, width=1500)
test_dataset_generator.show()
{% endraw %} {% raw %}

class ObjectDetectionResultOverview[source]

ObjectDetectionResultOverview(object_detection_result_dataset) :: Dashboard

Helper class that provides a standard way to create an ABC using inheritance.

{% endraw %} {% raw %}
{% endraw %} {% raw %}
odrd = ObjectDetectionResultsDataset.load("test_results/pets_train.dat")
odrdash = ObjectDetectionResultOverview(odrd)
80.00% [8/10 01:13<00:18 iou: 0.9]
100.00% [2948/2948 00:08<00:00]
---------------------------------------------------------------------------
IndexError                                Traceback (most recent call last)
<ipython-input-12-f94ef1c7e890> in <module>
      1 odrd = ObjectDetectionResultsDataset.load("test_results/pets_train.dat")
----> 2 odrdash = ObjectDetectionResultOverview(odrd)

<ipython-input-11-8f8ac1d2a4f2> in __init__(self, object_detection_result_dataset)
      2 class ObjectDetectionResultOverview(Dashboard):
      3     def __init__(self, object_detection_result_dataset):
----> 4         super().__init__()
      5         self.object_detection_result_dataset = object_detection_result_dataset
      6 

~/Documents/GIT/icevision_dashboard/icevision_dashboards/core/dashboards.py in __init__(self, width, height)
     23         self.width = width
     24         self.height = height
---> 25         self.build_gui()
     26 
     27     @abstractmethod

<ipython-input-11-8f8ac1d2a4f2> in build_gui(self)
      6 
      7     def build_gui(self):
----> 8         loss_tab = self.build_loss_tab()
      9 
     10         self.gui = pn.Tabs(("Loss", loss_tab))

<ipython-input-11-8f8ac1d2a4f2> in build_loss_tab(self)
     27             )
     28             return hist_line
---> 29         pn.Column(bins_input, loss_hists)
     30 
     31         axis_cols = ['score', 'area_normalized', 'area', 'bbox_ratio', 'bbox_width', 'bbox_height', 'num_annotations', 'loss_classifier', 'loss_box_reg', 'loss_objectness', 'loss_rpn_box_reg', 'loss_total', 'width', 'height', 'label']

~/anaconda3/envs/icevision_dashboard/lib/python3.8/site-packages/panel/layout/base.py in __init__(self, *objects, **params)
    358                                  "as positional arguments or as a keyword, "
    359                                  "not both." % type(self).__name__)
--> 360             params['objects'] = [panel(pane) for pane in objects]
    361         elif 'objects' in params:
    362             params['objects'] = [panel(pane) for pane in params['objects']]

~/anaconda3/envs/icevision_dashboard/lib/python3.8/site-packages/panel/layout/base.py in <listcomp>(.0)
    358                                  "as positional arguments or as a keyword, "
    359                                  "not both." % type(self).__name__)
--> 360             params['objects'] = [panel(pane) for pane in objects]
    361         elif 'objects' in params:
    362             params['objects'] = [panel(pane) for pane in params['objects']]

~/anaconda3/envs/icevision_dashboard/lib/python3.8/site-packages/panel/pane/base.py in panel(obj, **kwargs)
     49     if kwargs.get('name', False) is None:
     50         kwargs.pop('name')
---> 51     pane = PaneBase.get_pane_type(obj, **kwargs)(obj, **kwargs)
     52     if len(pane.layout) == 1 and pane._unpack:
     53         return pane.layout[0]

~/anaconda3/envs/icevision_dashboard/lib/python3.8/site-packages/panel/param.py in __init__(self, object, **params)
    628         if object is not None:
    629             self._validate_object()
--> 630             self._update_inner(self.eval(object))
    631 
    632     @param.depends('object', watch=True)

~/anaconda3/envs/icevision_dashboard/lib/python3.8/site-packages/panel/param.py in eval(self, function)
    661                 args = (getattr(dep.owner, dep.name) for dep in arg_deps)
    662                 kwargs = {n: getattr(dep.owner, dep.name) for n, dep in kw_deps.items()}
--> 663         return function(*args, **kwargs)
    664 
    665     def _update_pane(self, *events):

~/anaconda3/envs/icevision_dashboard/lib/python3.8/site-packages/param/parameterized.py in _depends(*args, **kw)
    349     @wraps(func)
    350     def _depends(*args,**kw):
--> 351         return func(*args,**kw)
    352 
    353     deps = list(dependencies)+list(kw.values())

<ipython-input-11-8f8ac1d2a4f2> in loss_hists(bins)
     19         @pn.depends(bins_input.param.value)
     20         def loss_hists(bins):
---> 21             unique_losses = odrd.metric_base_data[["filepath", "loss_classifier", "loss_box_reg", "loss_objectness", "loss_rpn_box_reg", "loss_total"]].drop_duplicates()
     22             hist_line = plots_as_matrix(
     23                 histogram(

~/Documents/GIT/icevision_dashboard/icevision_dashboards/core/data.py in __get__(self, obj, objtype)
    100     def __get__(self, obj, objtype=None):
    101         if getattr(obj, self.private_name) is None:
--> 102             value = self.calculate_description(obj)
    103             setattr(obj, self.private_name, value)
    104         return getattr(obj, self.private_name)

~/Documents/GIT/icevision_dashboard/icevision_dashboards/data.py in calculate_description(self, obj)
    270         iou_bar.main_bar.comment = f"iou: {self.ious[0]}"
    271         for index,iou in enumerate(iou_bar):
--> 272             iou_bar.main_bar.comment = f"iou: {self.ious[index+1]}"
    273             data = getattr(obj, self.data_descriptor_name)
    274             data = data.copy()

IndexError: index 10 is out of bounds for axis 0 with size 10
{% endraw %} {% raw %}
odrdash.show()
{% endraw %}